package cn.ztuo.bitrade.controller;

import cn.ztuo.bitrade.entity.ContractCoin;
import cn.ztuo.bitrade.service.ContractBondService;
import cn.ztuo.bitrade.service.ContractCoinService;
import cn.ztuo.bitrade.util.ContractUtils;
import cn.ztuo.bitrade.util.MessageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("contract-coin")
public class ContractCoinController extends BaseController{
    @Autowired
    private ContractCoinService contractCoinService;
    @Autowired
    private ContractBondService bondService;

    //获取基币
    @PostMapping("base-symbol")
    public MessageResult baseSymbol() {

        List<ContractCoin> baseSymbol = ContractUtils.findBaseSymbols();
        if (baseSymbol != null && baseSymbol.size() > 0){
            return success(baseSymbol);
        }
        return error("baseSymbol null");
    }

    @RequestMapping("base-test")
    public String test(){
        return "启动成功";
    }

}
